<?php

header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../install_sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx[1],$dataxxx[2],$dataxxx[3]);//链接数据库

if($link)
{
    $select=mysqli_select_db($link,$dataxxx[4]);//选择数据库
echo mysqli_error();
  if($select)
  {
    if(isset($_POST["subl"]))
    {
      $password=$_POST["passwordl"];
      $str="select adminpass from `OurShareAdminPass`";
      mysqli_query('SET NAMES UTF8');
	  $result=mysqli_query($link,$str);
      $pass=mysqli_fetch_row($result);
      $pa=$pass[0];
      if($pa==$password)//判断密码与注册时密码是否一致
      {
setcookie("admin", "1", time()+3600000);

echo"<script type="."\""."text/javascript"."\"".">"."window.location="."\""."./index.php"."\""."</script>";
      }
      { 
      echo"<script type="."\""."text/javascript"."\"".">"."window.alert"."("."\""."登录失败！"."\"".")".";"."</script>"; echo"<script type="."\""."text/javascript"."\"".">"."window.location="."\""."./login.php"."\""."</script>";
      }
    }  
  }
}
?>